home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / OS / FWGraphx / Include / FWOvlShp.h < prev    next >
Encoding:
Text File  |  1994-04-21  |  3.6 KB  |  129 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWOvlShp.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/28/94
  7. //
  8. //    Copyright:    © 1993, 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWOVLSHP_H
  13. #define FWOVLSHP_H
  14.  
  15. #ifndef FWSHAPE_H
  16. #include "FWShape.h"
  17. #endif
  18.  
  19. #ifndef FWBNDSHP_H
  20. #include "FWBndShp.h"
  21. #endif
  22.  
  23. //==============================================================================
  24. //    •• Forward Declarations
  25. //==============================================================================
  26.  
  27. class FW_CGraphicContext;
  28. class FW_COvalShapeRep;
  29. class FW_CRectShape;
  30. class FW_CRoundRectShape;
  31. class FW_CArcShape;
  32. class FW_CLineShape;
  33. class FW_CRegionShape;
  34.  
  35. //==============================================================================
  36. //    •• CLASS FW_COvalShape
  37. //==============================================================================
  38.  
  39. class FW_COvalShape : public FW_CShape
  40. {
  41. //------------------------------------------------------------------------------
  42. //    • Constructors
  43. //
  44. public:
  45.     FW_COvalShape();
  46.     FW_COvalShape(const FW_CRect& rect);
  47.     
  48.     FW_COvalShape(const FW_COvalShape& other);
  49.     FW_COvalShape(FW_COvalShapeRep* rep);
  50.             
  51. //-------------------------------------------------------------------------------
  52. //    • operators
  53. //
  54. public:
  55.     FW_COvalShape& operator=(const FW_COvalShape& other);
  56.     FW_COvalShape& operator=(FW_COvalShapeRep* other);
  57.         
  58.     FW_COvalShapeRep* operator->() const
  59.                 {return (FW_COvalShapeRep*)GetRep();}
  60.     
  61. //----------------------------------------------------------------------------------------
  62. //    • Conversion
  63. //
  64. public:
  65.     operator FW_CRectShape() const;
  66.     operator FW_CRoundRectShape() const;
  67.     operator FW_CArcShape() const;
  68.     operator FW_CLineShape() const;
  69.     operator FW_CRegionShape() const;
  70.  
  71. //--------------------------------------------------------------------------------
  72. //    • Static Methods
  73. //
  74. public:
  75.     static void DrawOval(FW_CGraphicContext* graphicContext, const FW_CRect& rect);
  76. };
  77.  
  78. //==============================================================================
  79. //    •• class FW_COvalShapeRep
  80. //==============================================================================
  81.  
  82. class FW_COvalShapeRep : public FW_CBoundedShapeRep
  83. {
  84.     friend class FW_COvalShape;
  85.     
  86. //------------------------------------------------------------------------------
  87. //    • Constructors/Destructors
  88. //
  89. protected:
  90.     FW_COvalShapeRep();
  91.     FW_COvalShapeRep(const FW_CRect& rect);
  92.     
  93.     virtual ~FW_COvalShapeRep();
  94.     
  95. //------------------------------------------------------------------------------
  96. //    • Inherited API
  97. //
  98. public:
  99.     // ----- Hit Testing -----
  100.     virtual FW_HitTestPart HitTest(const FW_CPoint& test) const;
  101.  
  102.     // ----- Rendering -----
  103.     virtual void     Draw(FW_CGraphicContext* graphicContext);
  104.     static void     DrawOval(FW_CGraphicContext* graphicContext, const FW_CRect& rect);
  105.     
  106.     // ----- Default shape -----
  107.     virtual void     SetAsDefault() const;
  108.     
  109. //------------------------------------------------------------------------------
  110. //    • New API
  111. //
  112. public:
  113.     FW_COvalShape    Copy() const;
  114. };
  115.  
  116. //==============================================================================
  117. //    •• Inlines
  118. //==============================================================================
  119.  
  120. //------------------------------------------------------------------------------
  121. //    • FW_COvalShape::DrawOval
  122. //------------------------------------------------------------------------------
  123. inline static void FW_COvalShape::DrawOval(FW_CGraphicContext* graphicContext, const FW_CRect& rect)
  124. {
  125.     FW_COvalShapeRep::DrawOval(graphicContext, rect);
  126. }
  127.  
  128.  
  129. #endif